package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ConstractSupplierMapper;
import com.ruoyi.system.domain.ConstractSupplier;
import com.ruoyi.system.service.IConstractSupplierService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-04
 */
@Service("supplier")
public class ConstractSupplierServiceImpl implements IConstractSupplierService 
{
    @Autowired
    private ConstractSupplierMapper constractSupplierMapper;

    /**
     * 查询供应商
     * 
     * @param id 供应商主键
     * @return 供应商
     */
    @Override
    public ConstractSupplier selectConstractSupplierById(Long id)
    {
        return constractSupplierMapper.selectConstractSupplierById(id);
    }

    /**
     * 查询供应商列表
     * 
     * @param constractSupplier 供应商
     * @return 供应商
     */
    @Override
    public List<ConstractSupplier> selectConstractSupplierList(ConstractSupplier constractSupplier)
    {
        return constractSupplierMapper.selectConstractSupplierList(constractSupplier);
    }

    @Override
    public List<ConstractSupplier> selectList()
    {
        ConstractSupplier constractSupplier = new ConstractSupplier();
        return constractSupplierMapper.selectConstractSupplierList(constractSupplier);
    }
    /**
     * 新增供应商
     * 
     * @param constractSupplier 供应商
     * @return 结果
     */
    @Override
    public int insertConstractSupplier(ConstractSupplier constractSupplier)
    {
        return constractSupplierMapper.insertConstractSupplier(constractSupplier);
    }

    /**
     * 修改供应商
     * 
     * @param constractSupplier 供应商
     * @return 结果
     */
    @Override
    public int updateConstractSupplier(ConstractSupplier constractSupplier)
    {
        return constractSupplierMapper.updateConstractSupplier(constractSupplier);
    }

    /**
     * 批量删除供应商
     * 
     * @param ids 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteConstractSupplierByIds(String ids)
    {
        return constractSupplierMapper.deleteConstractSupplierByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除供应商信息
     * 
     * @param id 供应商主键
     * @return 结果
     */
    @Override
    public int deleteConstractSupplierById(Long id)
    {
        return constractSupplierMapper.deleteConstractSupplierById(id);
    }
}
